/*
   Root, Router 配置
*/
import React from "react";
import { Route, Switch, Redirect } from "react-router-dom";
import lazyLoad from "./lazyLoad";
// const Main = lazyLoad(() => import("pages/main"));
// const Home = lazyLoad(() => import("pages/home"));
// import Home from '../pages/home/index'

const Home = lazyLoad(() => import("pages/home"));
const ShopCart = lazyLoad(() => import("pages/shopCart"));
const Classify = lazyLoad(() => import("pages/classify"));
const ClassifyGoodDetail = lazyLoad(() => import("pages/classify/goodDetail"));
const ClassifyPayOrder = lazyLoad(() => import("pages/classify/payOrder"));
const Me = lazyLoad(() => import("pages/me"));
const Order = lazyLoad(() => import("pages/order"));
const OrderDetail = lazyLoad(() => import("pages/order/detail"));
const SetTing = lazyLoad(() => import("pages/setting"));
const UserInfo = lazyLoad(() => import("pages/setting/info"));

const Root = () => (
    <Switch>
        <Route exact path="/" component={Home} />
        {/*首页*/}
        <Route exact path="/home" component={Home} />
        {/*分类*/}
        <Route exact path="/classify" component={Classify} />
        <Route exact path="/classify/good/detail" component={ClassifyGoodDetail} />
        <Route exact path="/classify/good/payOrder" component={ClassifyPayOrder} />
        {/*购物车*/}
        <Route exact path="/shopCart" component={ShopCart} />
        {/*我的*/}
        <Route exact path="/me" component={Me} />
        {/*订单*/}
        <Route exact path="/order" component={Order} />
        <Route exact path="/order/detail" component={OrderDetail} />
		{/*s设置*/}
		<Route exact path="/setting" component={SetTing} />
		{/*s用户信息*/}
		<Route exact path="/setting/info" component={UserInfo} />
        {/*<Route path="/classify" component={Classify} />*/}
        {/*<Route path="/me" component={Me} />*/}
        {/*<Redirect to="/"/>*/}
        {/*<Route path="/home" exact component={Home} />*/}
        {/*<Route path="/main/:ticketId" exact component={Main} />*/}
        <Redirect to="/home" />
		
    </Switch>
);

export default Root;
